Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
¿Por qué la variable "var name" se inicializa como una cadena cuando intenta inicializarla como una matriz en Javascript?

Cuando uso "nombre" como nombre de variable y uso la palabra clave var, la variable "nombre" no se inicializa como matriz.

 var name = ['banana', 'kiwi']; Object.getPrototypeOf(name) == String.prototype; // true

Pero cuando uso la palabra clave const, funciona normalmente.

 const name = ['banana', 'kiwi']; Object.getPrototypeOf(name) == Array.prototype; // true

O cuando uso un nombre de variable diferente, también funciona normalmente.

 var name2 = ['banana', 'kiwi']; Object.getPrototypeOf(name2) == Array.prototype; // true

¿Por qué pasó esto?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!